//
//  CLRequestTool.h
//  CarLifes
//
//  Created by yu on 2017/7/31.
//  Copyright © 2017年 jpas. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "InterfacedConst.h"
#import "HTTPRequest.h"
#import "MBProgressHUD+MJ.h"
#import "User.h"
#import "EqnoLoginModel.h"

@class HTTPRequest;
@class TraceModel;
@class AlarmModel;

@interface RequestTool : NSObject

@property (nonatomic, strong) User *user;

/** 获取下级部门*/
- (void)findDeptsByDeptId:(NSString *)deptId success:(void (^)(NSArray *depts))success failure:(void (^)(NSString *error))failure;

/** 账户登录*/
- (void)loginByAccount:(NSString *)account password:(NSString *)password isSavePwd:(BOOL)isSave success:(void (^)(int status))success failure:(void (^)(NSString *error))failure;

/** 修改用户个人资料*/
- (void)updateUserInfoName:(NSString *)name email:(NSString *)email mobile:(NSString *)mobile success:(void (^)())success failure:(void (^)(NSError *error))failure;

/** 更改账户密码*/
- (void)modifyUserPassword:(NSString *)newPassword success:(void (^)())success failure:(void (^)(NSError *error))failure;

/** 平台列表(搜索设备、获取帐号设备、获取用户信息公用该接口)*/
- (void)loadEquipmentListByPage:(NSInteger)page size:(NSInteger)size status:(NSString *)status actStatus:(NSString *)actStatus str:(NSString *)str isNeedDeptId:(BOOL)isNeedDeptId show:(BOOL)show success:(void (^)(NSArray *equipments,NSArray *equipCounts))success failure:(void (^)(NSError *error))failure;

- (void)loadEquipsByPage:(NSInteger)page size:(NSInteger)size status:(NSString *)status actStatus:(NSString *)actStatus str:(NSString *)str deptId:(NSString *)deptId show:(BOOL)show success:(void (^)(NSArray *equips,NSArray *equipCounts))success failure:(void (^)(NSString *error))failure;

/** 获取设备状态*/
- (void)loadEquipmentStatusStr:(NSString *)str success:(void (^)(NSArray *eqList))success failure:(void (^)(NSError *error))failure;

/** 车架号登录*/
- (void)loginByVin:(NSString *)vin password:(NSString *)password isSavePwd:(BOOL)isSave success:(void (^)(int status,NSArray *equipmentList))success failure:(void (^)(NSError *error))failure;

/** 上传安装拍照照片*/
- (void)uploadImagesByEqId:(NSString *)eqId installer:(NSString *)installer installerPhone:(NSString *)installerPhone installerPosition:(NSString *)installerPosition images:(NSArray <UIImage *> *)images eqPosition:(NSString *)eqPosition success:(void (^)(int status))success failure:(void (^)(NSError *error))failure;

/** 设备拍照查询*/
- (void)queryEquipImgByEqId:(NSString *)eqId show:(BOOL)show success:(void (^)(NSArray *results))success failure:(void (^)(NSError *error))failure;

/** 上传补拍照片*/
- (void)uploadRepearImgByEqId:(NSString *)eqId img:(UIImage *)img type:(NSString *)type success:(void (^)(int status))success failure:(void (^)(NSError *error))failure;
- (void)uploadRepearImgByEqId666:(NSString *)eqId images:(NSArray<UIImage *> *)images types:(NSArray<NSString *> *)types success:(void (^)(int status))success failure:(void (^)(NSError *error))failure;

/** 设备号登录(安装拍照登录)*/
- (void)eqNoLoginByEqno:(NSString *)eqno success:(void (^)(EqnoLoginModel *eqnoModel,int status))success failure:(void (^)(NSError *error))failure;

/** 查询历史轨迹*/
- (void)loadHistoryTrackByEqno:(NSString *)eqno startTime:(NSString *)startTime endTime:(NSString *)endTime success:(void (^)(NSArray *historyArray,int status))success failure:(void (^)(NSError *error))failure;

/** 查询实时轨迹*/
- (void)loadRealTrackByEqno:(NSString *)eqno show:(BOOL)show success:(void (^)(TraceModel *tModel))success failure:(void (^)(NSError *error))failure;

/** 意见反馈*/
- (void)feedbackByInfo:(NSString *)info contact:(NSString *)contact phone:(NSString *)phone app:(NSString *)app success:(void (^)())success failure:(void (^)(NSError *error))failure;

/** 报警查询*/
- (void)loadAlarmListByPage:(NSInteger)page eqNos:(NSString *)eqNos egId:(NSString *)egId success:(void (^)(NSArray *alarmArray))success failure:(void (^)(NSError *error))failure;
- (void)loadAlarmsByPage:(NSInteger)page eqNos:(NSString *)eqNos egId:(NSString *)egId success:(void (^)(NSArray *alarms))success failure:(void (^)(NSString *))failure;

/** 违章查询城市*/
- (void)loadAllCitySuccess:(void (^)(NSMutableArray *dataArray))success failure:(void (^)(NSString *error))failure;
/**
 违章查询

 @param city 城市代码
 @param hphm 号牌号码 完整7位 ,需要utf8 urlencode
 @param hpzl 号牌类型，默认02
 @param engineno 发动机号 (根据城市接口中的参数填写)
 @param classno  车架号 (根据城市接口中的参数填写)
 @param success 成功回调
 @param failure 失败回调
 */
- (void)queryVehicleInfoByCity:(NSString *)city
                          hphm:(NSString *)hphm
                          hpzl:(NSString *)hpzl
                      engineno:(NSString *)engineno
                       classno:(NSString *)classno
                       success:(void (^)(NSMutableArray *resultList,NSString *tip))success
                       failure:(void (^)(NSString *error))failure;


/** 新闻资讯*/
- (void)loadNews:(NSString *)type show:(BOOL)show success:(void (^)(NSMutableArray *newsList))success
         failure:(void (^)(NSString *error))failure;

/** 工单系统登录*/
- (void)workorderLogin:(NSString *)account isSaveAccount:(BOOL)isSave success:(void (^)(int status,NSString *installId))success failure:(void (^)(NSError *error))failure;

/** 工单查询*/
- (void)workorderFind:(NSString *)installerId page:(NSInteger)page status:(NSString *)status str:(NSString *)str success:(void (^)(NSMutableArray *workorderList))success failure:(void (^)(NSString *error))failure;

/** 安装工单完结(修改工单状态)*/
- (void)workorderUpdateStatus:(NSString *)woId status:(NSString *)status workEqnos:(NSString *)workEqnos success:(void (^)(BOOL isFinish))success failure:(void (^)(NSString *error))failure;

/** 查询家访工单题目*/
- (void)loadVisitingQuestionByVisId:(NSString *)visId visType:(NSString *)visType success:(void (^)(NSMutableArray *questionList))success failure:(void (^)(NSString *error))failure;
/** 家访工单提交题目*/
- (void)workorderUpdateVisStatus:(NSString *)str success:(void (^)(BOOL isFinish))success failure:(void (^)(NSString *error))failure;

/** 上传家访图片*/
- (void)uploadWoVisImgByWoId:(NSString *)woId images:(NSArray <UIImage *> *)images success:(void (^)(int status))success failure:(void (^)(NSString *error))failure;
/** 上传安装师傅位置*/
- (void)uploadInstallerLocationByInstallId:(NSString *)installId lat:(NSString *)lat lng:(NSString *)lng success:(void (^)())success failure:(void (^)(NSString *error))failure;
/** 查询违章高发地*/
- (void)loadHighVioByLat:(NSString *)lat lng:(NSString *)lng num:(NSString *)num range:(NSString *)range success:(void (^)(NSMutableArray *vios))success failure:(void (^)(NSString *error))failure;
/** 修改账户密码*/
- (void)changeAccPsd:(NSString *)psd isSavePsd:(BOOL)isSave success:(void (^)(void))success failure:(void (^)(NSString *))failure;
/** 修改车架号登录密码*/
- (void)changeVinPsd:(NSString *)psd eqId:(NSString *)eqId success:(void (^)(void))success failure:(void (^)(NSString *))failure;

@end


